#include "namedpipe.hpp"
int main()
{
    NamedPipe fifo(fifo_path, Server);
    if (fifo.OpenForRead())
    {
        std::cout << "server opend fifo" << std::endl;
        while (true)
        {
            std::string message;
            int n = fifo.ReadPipe(&message);
            if (n > 0)
            {
                std::cout << "fifo read:" << message << std::endl;
            }
            else if (n == 0)
            {
                std::cout << "client quit,server too" << std::endl;
                break;
            }
            else
            {
                std::cout << "read has error" << std::endl;
                break;
            }
        }
    }
    return 0;
}